1. Field of the Invention
The present invention relates to a white balance correction of an image captured by an imaging apparatus.
2. Description of the Related Art
Generally, imaging apparatuses using an image sensor such as a digital camera and a digital video camera are provided with the white balance control function for adjusting a color tone of an image captured by an imaging operation. This white balance control includes manual white balance control which acquires a white balance coefficient by imaging a white object in advance and applies the calculated white balance coefficient to the entire screen. Further, the white balance control includes automatic white balance control which automatically detects a possible white portion from a captured image, calculates a white balance coefficient from an average value of each color component in the entire screen, and applies the calculated white balance coefficient to the entire screen.
Now, a conventional method of the automatic white balance control will be described. An analog signal output from an image sensor is converted into a digital signal by analog/digital (A/D) conversion, and is divided into a plurality of blocks as illustrated in FIG. 3. Each of the blocks is constituted by red (R), green (G), and blue (B) color pixels, and a color evaluation value (Cx[i], Cy[i]) is calculated for each block by, for example, the following equation (1).Cx[i]=(R[i]−B[i])/Y[i]×1024Cy[i]=(R[i]−B[i])−2G[i]/Y[i]×1024(In this equation, i represents a block number, R[i], G[i], and B[i] each represent an average value of RGB pixels included in the block i, and Y[i]=(R[i]+2G[i]+B[i])/4)
Then, if the calculated color evaluation value (Cx[i], Cy[i]) falls within a preset white detection range, that block is determined as a white block. Then, the summation value (SumR, SumG, SumB) of the color pixels included in such blocks is calculated, and the white balance coefficient (WBCo_R, WBCo_G, WBCo_B) is calculated by the following equation (2).WBCo_R=SumY×1024/sumR WBCo_G=SumY×1024/sumG WBCo_B=SumY×1024/sumB  [EQUATION 2](In this equation, SumY=(sumR+2×sumG+sumB)/4.)
However, such automatic white balance control has the following problem; even in a scene where there is a plurality of different light sources in an image, an imaging apparatus performs the white balance control by applying the white balance coefficient calculated as mentioned above to the entire screen. Therefore, it is difficult to perform the white balance control so as to achieve appropriate color tints for all of the light sources. For example, in a scene where an imaging apparatus emits flash light which is a light source having a high color temperature, if the ambient light contains a low color temperature light source such as a light bulb color source, the white balance controlled on the basis of the flash light results in unsuitable white balance for the low color temperature light source in the ambient light. On the other hand, the white balance controlled on the basis of the low color temperature light source of the ambient light results in unsuitable white balance for the flash light. Further, even if the imaging apparatus performs the white balance control by adjusting the white balance to the middle between the respective light sources, this results in unsuitable white balance for both of the light sources, leading to generation of an image in which a region irradiated with the flash light is tinged with blue while a region irradiated with the low color temperature light source is tinged with red.
Therefore, to solve this problem, for example, the technique discussed in Japanese Patent No. 3540485 calculates a data ratio by comparing an image captured with the flash on, to an image captured with the flash off for each arbitrary object region, and determines a degree of contribution of the flash light based on the calculated ratio value. Then, this technique performs the white balance control by selecting a white balance control value for each region as to video data captured by carrying out an exposure with the flash light on according to a degree of contribution.
However, the conventional technique discussed in Japanese Patent No. 3540485 is designed to be used in white balance control of an image captured while the flash light is emitted, and cannot be applied to an image captured while the flash light is not emitted. Further, this conventional technique performs a development process after varying the white balance control value for each region, whereby other control such as color reproduction may become inappropriate to the white balance control value. As a result, the conventional technique cannot fully reproduce an appropriate tint.